package com.qst.crop.service.impl;


import com.qst.crop.dao.OrderAndShopDao;
import com.qst.crop.entity.OrderAndShop;
import com.qst.crop.service.OrderAndShopService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class OrderAndShopServiceImpl implements OrderAndShopService {


    private static final Logger log = LoggerFactory.getLogger(OrderAndShopServiceImpl.class);
    @Autowired
    OrderAndShopDao orderAndShopDao;

    @Transactional
    @Override
    public void commit(OrderAndShop orderAndShop){
        log.info("order "+orderAndShop);
        orderAndShopDao.commitOrder(orderAndShop);
        orderAndShopDao.commitShop(orderAndShop);
    }
}
